package com.example.config.resp;

import java.io.IOException;
import java.util.Iterator;
import java.util.Map.Entry;
import java.util.Properties;
import java.util.Set;

import javax.annotation.PostConstruct;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;

public class RtnMsgUtil {

	@Autowired
	@Qualifier("propUtil")
	private Properties propUtil;
	
	@PostConstruct
	public void loadCode() throws IOException{
		Set<Entry<Object, Object>> set = propUtil.entrySet();
		Iterator<Entry<Object, Object>> it = set.iterator();
		while(it.hasNext()){
			Entry<Object, Object> e = it.next();
			RtnCode.CODEMAP.put(e.getKey().toString(), e.getValue().toString());
		}
	}
	
	public String get(String key){
		return propUtil.getProperty(key);
	}
	
}
